package cn.com.nes.site.service.project.dto;

import cn.com.nes.mybatis.agent.project.entity.ProjectServiceUserAreaCode;
import cn.com.nes.mybatis.agent.project.entity.ProjectServiceUserAuth;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 项目服务权限DTO
 */
@Data
public class ProjectServiceUserAuthDTO {

    /**
     * 启用标识
     */
    private Integer enableIdentity;

    /**
     * 项目服务人员
     */
    private ProjectServiceUserAuth projectServiceUserAuth;

    /**
     * 项目服务人员服务区域
     */
    private List<ProjectServiceUserAreaCode> projectServiceUserAreaCodeServices;

    /**
     * 服务区域范围
     */
    private List<String> serviceAreaCodes;

    public boolean hasServiceAreaCode() {
        if (projectServiceUserAreaCodeServices == null || projectServiceUserAreaCodeServices.isEmpty()) {
            return false;
        }
        return true;
    }

    public ProjectServiceUserAuth settingEnableIdentity(Long operateUserId, Date operateDate) {
        this.getProjectServiceUserAuth().setEnableIdentity(this.enableIdentity);
        this.getProjectServiceUserAuth().setGmtModifiedId(operateUserId);
        this.getProjectServiceUserAuth().setGmtModified(operateDate);
        return this.getProjectServiceUserAuth();
    }

}
